<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<div class="pad_10">
<form action="?m=speciallist&c=speciallist&a=add" method="post" name="myform" id="myform">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
	
	<tr>
		<th width="100">栏目名：</th>
		<td><input type="text" name="cat[catName]" id="catName"
			size="40" class="input-text"></td>
	</tr>
	
	<tr>
		<th width="100">外部链接：</th>
		<td><input type="text" name="cat[url]" id="url"
			size="40" class="input-text"></td>
			<input type="hidden" name="forward" value="?m=contentmanage&c=contentmanage&a=add"> <input
		type="submit" name="dosubmit" id="dosubmit" class="dialog"value="提交"><input type="hidden" name="type" value="<?php echo $_GET['type'];?>">
	</tr>
	<tr>
		<th width="100">是否显示栏目：</th>
		<td>是&nbsp;:&nbsp;<input type="radio" name="cat[display]" value="1" checked>&nbsp;&nbsp;否&nbsp;:&nbsp;<input type="radio" name="cat[display]" value="0"></td>
	</tr>
</table>
</form>
</div>
</body>
</html> 
<script type="text/javascript">
<!--
$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'400',height:'70'}, function(){this.close();$(obj).focus();})}});
	$('#url').formValidator({
		onshow:"请输入一个链接，如：http://www.baidu.com/",
		onfocus:"请输入一个链接，如：http://www.baidu.com/",
		oncorrect:"OK"}).inputValidator(
			{
				min:1,
				onerror:"链接不能为空"
			}).ajaxValidator({
				type:"get",
				url:"",
				data:"m=speciallist&c=speciallist&a=check&check=add&type=<?php echo $_GET['type'];?>",
				datatype:"html",
				cached:false,
				async:'true',
				success: 
					function(data) {if( data == "1" ){return true;}else{return false;}},
	error: function(){alert("数据不存在");},
	onerror : "",
	onwait : "检测中..."
	});
	$('#catName').formValidator({
		onshow:"请输入栏目名",
		onfocus:"请输入栏目名",
		oncorrect:"OK"}).inputValidator(
			{
				min:1,
				onerror:"栏目名不能为空"
			}).ajaxValidator({
				type:"get",
				url:"",
				data:"m=speciallist&c=speciallist&a=check&check=add&type=<?php echo $_GET['type'];?>",
				datatype:"html",
				cached:false,
				async:'true',
				success : 
					function(data) {if( data == "1" ){return true;}else{return false;}},
	error: function(){alert("数据不存在");},
	onerror : <?php if($_GET['type'] == "speciallist")echo '"栏目名已存在"';else echo '"栏目已存在或者地图指南、友情链接两个栏目总数超过10"'?>,
	onwait : "检测中..."
	});
});
//-->
</script>